nlp_architect.api package

Submodules

nlp_architect.api.abstract_api module

class nlp_architect.api.abstract_api.AbstractApi[source]

Bases: object

Abstract class for API’s to the server

inference(doc)[source]
load_model()[source]

nlp_architect.api.base module

class nlp_architect.api.base.ModelAPI(model_path: str = None)[source]

Bases: object

Base class for a model API implementation Implementing classes must provide a default model and/or a path to a model

Parameters:model_path (str) – path to a trained model

run method must return

default_model = None
load_model(model_path: str)[source]
run(inputs: Union[str, List[str]]) → Dict[source]

nlp_architect.api.bist_parser_api module

class nlp_architect.api.bist_parser_api.BistParserApi[source]

Bases: nlp_architect.api.abstract_api.AbstractApi

Bist Parser API

inference(doc)[source]

Parse according to SpacyBISTParser’s model

Parameters:doc (str) – the doc str
Returns:the parser’s response hosted in CoreNLPDoc object
Return type:CoreNLPDoc
load_model()[source]

Load SpacyBISTParser model

nlp_architect.api.intent_extraction_api module

class nlp_architect.api.intent_extraction_api.IntentExtractionApi(prompt=True)[source]

Bases: nlp_architect.api.abstract_api.AbstractApi

static display_results(text_str, predictions, intent_type)[source]
inference(doc)[source]
load_model()[source]
model_dir = '/Users/pizsak/nlp-architect/cache/intent-pretrained'
pretrained_model = '/Users/pizsak/nlp-architect/cache/intent-pretrained/model.h5'
pretrained_model_info = '/Users/pizsak/nlp-architect/cache/intent-pretrained/model_info.dat'
process_text(text)[source]
vectorize(doc, vocab, char_vocab=None)[source]

nlp_architect.api.machine_comprehension_api module

class nlp_architect.api.machine_comprehension_api.MachineComprehensionApi(prompt=True)[source]

Bases: nlp_architect.api.abstract_api.AbstractApi

Machine Comprehension API

data_dir = '/Users/pizsak/nlp-architect/cache/mrc-pretrained/mrc_data'
data_path = '/Users/pizsak/nlp-architect/cache/mrc-pretrained/mrc_data/data'
dir = '/Users/pizsak/nlp-architect/cache/mrc-pretrained'
download_model()[source]
get_paragraphs()[source]
inference(doc)[source]
load_model()[source]
model_dir = '/Users/pizsak/nlp-architect/cache/mrc-pretrained/mrc_trained_model'
model_path = '/Users/pizsak/nlp-architect/cache/mrc-pretrained/mrc_trained_model/trained_model'
static paragraphs(valid, vocab_tuple, num_examples)[source]
static questions(valid, vocab_tuple, num_examples)[source]

nlp_architect.api.ner_api module

class nlp_architect.api.ner_api.NerApi(prompt=True)[source]

Bases: nlp_architect.api.abstract_api.AbstractApi

NER model API

inference(doc)[source]
load_model()[source]
model_dir = '/Users/pizsak/nlp-architect/cache/ner-pretrained'
pretrained_model = '/Users/pizsak/nlp-architect/cache/ner-pretrained/model_v4.h5'
pretrained_model_info = '/Users/pizsak/nlp-architect/cache/ner-pretrained/model_info_v4.dat'
static pretty_print(text, tags)[source]
process_text(text)[source]
vectorize(doc, vocab, char_vocab)[source]

Module contents